package com.sskj.phoenixcoin.presenter;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.phoenixcoin.activity.AppAddBankActivity;
import com.sskj.phoenixcoin.http.HttpConfig;


public class AppAddBankActivityPresenter extends BasePresenter<AppAddBankActivity> {
    public void updateBank(String stockUserId, String id, String bankCardNo, String bankCardType, String bankCardOpenBank, String username) {
        OkGo.<HttpData<String>>post(HttpConfig.BASE_URL + HttpConfig.BANKUPDATE)
                .params("systemType", "ANDROID")
                .params("id", id)
                .params("stockUserId", stockUserId)
                .params("bankCardNo", bankCardNo)
                .params("bankCardType", bankCardType)
                .params("bankCardOpenBank", bankCardOpenBank)
                .params("username", username)
                .tag(this)
                .execute(new JsonCallBack<HttpData<String>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<String>> response) {
                        HttpData body = response.body();
                        ToastUtil.showShort(body.getMsg());
                        if (body.getStatus() == HttpConfig.OK) {
                            mView.finish();
                        }
                    }
                });
    }
}
